<?php
class LoginFilter extends CFilter{
	protected function preFilter($filterChain)
    {
       
    	// logic being applied before the action is executed
        if(yii::app()->user->isGuest){
        	
        	$filterChain->controller->redirect(array('site/login_page','mess'=>'您还没有登录,请登录.'));
        
        }
    	return true; // false if the action should not be executed
    }
 
    protected function postFilter($filterChain)
    {
        // logic being applied after the action is executed
    }
	
}
?>